package Features;

import java.io.File;
import com.aliasi.chunk.Chunker;
import com.aliasi.chunk.Chunking;
import com.aliasi.util.AbstractExternalizable;
import core.RunChunker;


public class NamedEntities extends Feature{

	public String trainedchunker = new String("myChunker");
	
	public int quantasEntidadesDoTipo(String sentence, String tipoEntidade) throws Exception{
		File modelFile = new File(trainedchunker);
		Chunker chunker = (Chunker) AbstractExternalizable.readObject(modelFile);
		Chunking chunking = chunker.chunk(sentence);
		
		return RunChunker.QuantasEntidades(chunking.toString(), tipoEntidade);
	}
	
}
